feat(i18n): add multi-language support and implement app internationalization#87
Merged
alecdotdev merged 1 commit intoalecdotdev:masterfrom Mar 30, 2026
Merged
Conversation
…lization Add full i18n support for the application, including: 1. Add language selector in settings supporting 10 languages including English and Chinese 2. Add translated text for all UI elements 3. Implement dynamic language switching 4. Add automatic system language detection 5. Enable i18n support for editor, modals, menus and other components 6. Update settings storage to save language preference Refactor hard-coded text across the app to use translation functions.
Owner
|
this is great! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Complete Internationalization (i18n) Support
Overview
Added comprehensive multi-language internationalization support to the Markpad application, supporting 10 languages with automatic OS language detection.
Supported Languages
enjazh-CNzh-TWkoruesfrdept-BRKey Changes
1. Core Translation System (
src/lib/utils/i18n.ts)LanguageCodetype definition supporting 10 language codestranslationsobject with the following categories:settings- All settings page textmenu- Menu items (File, Edit, View, Help, etc.)toast- Toast notificationsmodal- Dialog texthome- Home page texteditor- Editor status bartooltip- Tooltip texttheme- Theme optionsinstaller/uninstaller- Installer/Uninstaller texttabs- Tab labelscommon- Common buttonst()translation function with nested key supportgetSupportedLanguages()function to retrieve supported languages2. Settings Store (
src/lib/stores/settings.svelte.ts)LanguageCodetype andSUPPORTED_LANGUAGESarraydetectSystemLanguage()function for automatic OS language detectionnavigator.language)3. Component Updates
TitleBar.svelte
currentLanguagereactive state$effectto sync withsettings.languagechangest()function for translationEditor.svelte
uiLanguagereactive stateSettings.svelte
Tab.svelte
MarkdownViewer.svelte
Technical Implementation Details
Svelte 5 Reactivity Pattern
Automatic Language Detection
Testing Checklist
Notes
Files Modified
src/lib/utils/i18n.ts- Core translation systemsrc/lib/stores/settings.svelte.ts- Settings store with language detectionsrc/lib/components/TitleBar.svelte- Title bar menussrc/lib/components/Editor.svelte- Editor actionssrc/lib/components/Settings.svelte- Settings pagesrc/lib/components/Tab.svelte- Tab context menussrc/lib/MarkdownViewer.svelte- Markdown viewer context menus